<!-- 财经小工具：数字转中文、数字加千位符 -->
<template>
 <div>

   <h1>财经小工具</h1>

   <div class="box">
     <ContentTitle title="数字转中文"></ContentTitle>
     <div>例：123.45 -> 壹佰贰拾叁元肆角伍分</div>
     <div class="num-box">
       <a-input placeholder="请输入数字" v-model="num2Chinese" @change="num2ChineseChange" />
       <div style="margin-left: 10px;">{{num2ChineseResult}}</div>
     </div>
   </div>

   <div class="box">
     <ContentTitle title="数字加千位符"></ContentTitle>
     <div class="num-box">
       <a-input placeholder="请输入数字" v-model="numAddT" @change="numAddTChange" />
       <div style="margin-left: 10px;">{{numAddTResult}}</div>
     </div>
   </div>

 </div>
</template>

<script>

export default {
  mounted() {},
  computed: {},
  data() {
    return {
      num2Chinese: null,
      num2ChineseResult: null,

      numAddT: null,
      numAddTResult: null,
    };
  },
  methods: {
    num2ChineseChange() {
      this.num2ChineseResult = this.$convert.n2c(this.num2Chinese);
    },
    numAddTChange() {
      this.numAddTResult = this.$convert.numAddComma(this.numAddT, 2, 1);
    },
  },
};
</script>

<style lang='less' scoped>
.num-box {
  display: flex;
  align-items: center;
}
</style>
